import java.util.LinkedList;

/*
 * @lc app=leetcode.cn id=125 lang=java
 *
 * [125] 验证回文串
 */

// @lc code=start
class Solution {
    public boolean isPalindrome(String s) {
        int A_a='A'-'a';
        LinkedList<Integer> data=new LinkedList<>();
        for (Character character : s.toCharArray()) {
            if (character>='A'&& character<='Z') {
                data.addLast(character-'A');
            }
            else if (character>='a'&& character<='z') {
                data.add(character-'a');
            }
            else if (character>='0'&& character<='9') {
                data.add((int)character);
            }
            
        }
        while(data.size()>1){
            if (data.pollFirst()!=data.pollLast()) {
                return false;
                
            }
        }
        return true;
    }
}
// @lc code=end

